<?php

/**
 * description
 */
class BackendContestantForm extends ContestantForm
{
  /**
   * description
   */
  public function configure()
  {
    unset(
      $this['created_at'], 
      $this['updated_at'],
      $this['application_id'],
      $this['name'],
      $this['hits']
    );
    
    $this->widgetSchema['portrait'] = new sfWidgetFormInputFileEditable(array(
      'is_image' => true,
      'edit_mode' => !$this->isNew(),
      'file_src' => sprintf(sfConfig::get('app_path_contestant_portrait'), $this->getObject()->getPortrait()),
      'with_delete' => false
    ));
    $this->validatorSchema['portrait'] = new sfValidatorFile(array(
      'max_size' => 1 * 1024 * 1024,
      'path' => Wills::getUploadDirByWebPath(sfConfig::get('app_path_contestant_portrait')),
      'mime_types' => 'web_images',
      'required' => $this->isNew()
    ));
    
    $this->widgetSchema['image'] = new sfWidgetFormInputFileEditable(array(
      'is_image' => true,
      'edit_mode' => !$this->isNew(),
      'file_src' => sprintf(sfConfig::get('app_path_contestant_image'), $this->getObject()->getImage()),
      'with_delete' => false
    ));
    $this->validatorSchema['image'] = new sfValidatorFile(array(
      'max_size' => 3 * 1024 * 1024,
      'path' => Wills::getUploadDirByWebPath(sfConfig::get('app_path_contestant_image')),
      'mime_types' => 'web_images',
      'required' => $this->isNew()
    ));


  }
}
